package com.hx.net;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author jxlgcmh
 * @create 2019-05-10 15:32
 */
public class Demo1 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress myName = InetAddress.getByName("www.baidu.com");
        System.out.println(myName);
        System.out.println(myName.getHostAddress());
        System.out.println(myName.getHostName());
    }
}
